-
Notifications
You must be signed in to change notification settings - Fork 1.9k
config: Fix LLVM-21 -Wuninitialized-const-pointer warning #17684
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
9bd527e to
758eb97
Compare
LLVM-21 enables -Wuninitialized-const-pointer which results in the
following compiler warning and the bdev_file_open_by_path() interface
not being detected for 6.9 and newer kernels. The blk_holder_ops
are not used by the ZFS code so we can safely use a NULL argument
for this check.
bdev_file_open_by_path/bdev_file_open_by_path.c:110:54: error:
variable 'h' is uninitialized when passed as a const pointer
argument here [-Werror,-Wuninitialized-const-pointer]
Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
758eb97 to
6a4ed01
Compare
robn
approved these changes
Aug 30, 2025
Member
robn
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, this looks good to me. We are of course going to let a signature change through, but the actual build should catch that, and if not, CI. And if that gets through, maybe we have other life choices to consider.
behlendorf
added a commit
to behlendorf/zfs
that referenced
this pull request
Sep 10, 2025
LLVM-21 enables -Wuninitialized-const-pointer which results in the
following compiler warning and the bdev_file_open_by_path() interface
not being detected for 6.9 and newer kernels. The blk_holder_ops
are not used by the ZFS code so we can safely use a NULL argument
for this check.
bdev_file_open_by_path/bdev_file_open_by_path.c:110:54: error:
variable 'h' is uninitialized when passed as a const pointer
argument here [-Werror,-Wuninitialized-const-pointer]
Reviewed-by: Rob Norris <robn@despairlabs.com>
Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Closes openzfs#17682
Closes openzfs#17684
ptr1337
pushed a commit
to CachyOS/zfs
that referenced
this pull request
Oct 21, 2025
LLVM-21 enables -Wuninitialized-const-pointer which results in the
following compiler warning and the bdev_file_open_by_path() interface
not being detected for 6.9 and newer kernels. The blk_holder_ops
are not used by the ZFS code so we can safely use a NULL argument
for this check.
bdev_file_open_by_path/bdev_file_open_by_path.c:110:54: error:
variable 'h' is uninitialized when passed as a const pointer
argument here [-Werror,-Wuninitialized-const-pointer]
Reviewed-by: Rob Norris <robn@despairlabs.com>
Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Closes openzfs#17682
Closes openzfs#17684
This was referenced Nov 21, 2025
ptr1337
pushed a commit
to CachyOS/zfs
that referenced
this pull request
Nov 24, 2025
LLVM-21 enables -Wuninitialized-const-pointer which results in the
following compiler warning and the bdev_file_open_by_path() interface
not being detected for 6.9 and newer kernels. The blk_holder_ops
are not used by the ZFS code so we can safely use a NULL argument
for this check.
bdev_file_open_by_path/bdev_file_open_by_path.c:110:54: error:
variable 'h' is uninitialized when passed as a const pointer
argument here [-Werror,-Wuninitialized-const-pointer]
Reviewed-by: Rob Norris <robn@despairlabs.com>
Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Closes openzfs#17682
Closes openzfs#17684
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
Status: Accepted
Ready to integrate (reviewed, tested)
Type: Building
Indicates an issue related to building binaries
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Motivation and Context
#17682
Description
By default LLVM-21 enables -Wuninitialized-const-pointer which results in the following compiler warning and the
bdev_file_open_by_path()interface not being detected for 6.9 and newer kernels. Theblk_holder_opsare not used by the ZFS code so we can safely use a NULL argument for this check.Note: Initially I was inclined to initialize the
blk_holder_opsstruct which is the approach we use elsewhere, but after discovering how many times that structure has changed I opted for the simpler more robust change to pass NULL.How Has This Been Tested?
Locally compiled, but not on all of the relevant kernels. The CI can help out some there, but we'll also want to do some manual testing with the relevant llvm versions.
Types of changes
Checklist:
Signed-off-by.